package com.google.gwt.vector.client.ui;

import com.google.gwt.user.client.Element;
import com.google.gwt.vector.client.Vector;

/**
 *
 */
public class Circle extends BasicShape {

  private double x;
  private double y;

  private double radius;

  private Circle(Element elem) {
    super(elem);
  }

  public Circle(double coordinateX, double coordinateY, double radius) {
    this(Vector.createCircle());
    this.setCircleCoord(coordinateX, coordinateY);
    this.setRadius(radius);
    setColor(Color.BLACK);
    setStrokeColor(Color.BLACK);
    setStrokeWidth(1);
  }

  public void setCircleCoord(double coordinateX, double coordinateY) {
    this.x = coordinateX;
    this.y = coordinateY;
    Vector.setCircleCoord(getElement(), x, y, radius);
  }

  public void setRadius(double radius) {
    this.radius = radius;
    Vector.setRadius(getElement(), radius);
    setCircleCoord(x, y);
  }

}
